clear;clc;

SOLUTION_Baseline   =   load("../1_Baseline/2_MainResults/SOLUTION.mat",'SOLUTION_Main').SOLUTION_Main;
SOLUTION_TaylorRule_dY= load("../2_RobCheck_9_TaylorRule_dY/Result_TaylorRule_dY.mat",'SOLUTION').SOLUTION;

TempList    =   {SOLUTION_Baseline, SOLUTION_TaylorRule_dY};
LabelList   =   {'Baseline', 'TaylorRule_dY'};
TempNum     =   length(TempList);
Tables      =   cell(TempNum,1);

parfor ii=1:TempNum
    vv          =   TempList{ii};
    Tables{ii}  =   SubFun_CollectResults(vv);
end

FileName    =   'TableGraphs\\TaylorRule_dY.xlsx';
ShockList   =   {'Eps_Eta_M_dom', 'Eps_Eta_Y_H', 'Eps_Eta_M_ext'};
for ii=1:length(ShockList)
    SH          =   ShockList{ii};
    TempData    =   [];
    for jj=1:TempNum
        TempData    =   [TempData,Tables{jj}.(SH)];
    end
    TempTable   =   array2table(TempData,'VariableNames',LabelList,'RowNames',Tables{1}.Row);
    writetable(TempTable,FileName,'WriteRowNames',true,'Sheet',SH);
end